package com.tnstart.thread
{
	import com.tnstart.net.LocalHomeControlSocketDataImpl;

	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	import com.tnstart.DataSingleton;
	
	public class TNSThread extends EventDispatcher
	{
		public var _dataToPush:DataSingleton;
		
		private var timer:Timer;
		
		private var intev:int = 1000;
		
		public static var needCheckChairStatus:Boolean = false;
		
		public function TNSThread(dataToPush:DataSingleton)
		{
			_dataToPush = dataToPush;
			LocalHomeControlSocketDataImpl.getInstance().dataToPush = dataToPush;
			timer = new Timer(intev);
			timer.addEventListener(TimerEvent.TIMER, onTimer);
			timer.start();
		}
		
		protected function onTimer(event:Event):void
		{
			LocalHomeControlSocketDataImpl.getInstance().checkConnection();	
		}
	
	}
}